<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ include file="MainBricks/includeStuff.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Atrium Home Page</title>
<link href="style/style.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"
	type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script type="text/javascript" src="js/addfieldsbills.js"></script>

</head>
<body>
	<script>
		var contor = 0;
		$(document).ready(function() {
			$("#datepickerid").datepicker({ dateFormat: 'yy-mm-dd' });
		});
		function addAutocomplete() {
			contor += 1;
			$("#autocompleteinput" + contor).autocomplete({
				source :
					${productsNames}
				
		});
		}
		function removeAutoComplete() {
			if (contor != 0) {
				contor -= 1;
			}
		}
	</script>
	<div id="wrapper">
		<%@ include file="MainBricks/header.jsp"%>
		<!-- end #header -->
		<%@ include file="MainBricks/topmenu.jsp"%>
		<!-- end #menu -->
		<div id="page">
			<div id="page-bgtop">
				<div id="page-bgbtm">
					<div id="content">
						<%@ include file="MainBricks/includeinContent.jsp"%>

						<c:if test="${not empty alterResult}">
							<h3>${alterResult}</h3>
						</c:if>
						<form action="bill.do" method="post" name="input" class="stockform">
							<fieldset>
								<legend>Date Factura</legend>
								<table>
									<tr>
										<td>Nume Companie</td>
										<td><input type="text" name="numecompanie" value="${InitialParams['numeCompanie']}"
											required="required" /></td>
									</tr>
									<tr>
										<td>Nume Restaurant</td>
										<td><input type="text" name="restaurant1" value="${InitialParams['restaurant1']}"
											required="required" /></td>
									</tr>
									<tr>
										<td>Gestionar</td>
										<td><input type="text" name="gestionar" value="${InitialParams['gestionar']}"
											required="required" /></td>
									</tr>
									<tr>
										<td>Numar NIR (* sugerat)</td>
										<td><input type="text" name="numarnir" value="${numarNir}" required="required" pattern="\d+()?" /></td>
									</tr>
									<tr>
										<td>Data factura</td>
										<td><input type="text" name="datafactura" id="datepickerid" value="2011-12-31"
											required="required" /></td>
									</tr>
									<tr>
										<td>Furnizor</td>
										<td><select style="width: 160px" name="supName" required="required">
												<option></option>
												<c:forEach items="${suppliersNames}" var="sn">
													<option>${sn}</option>
												</c:forEach>
										</select></td>
									</tr>
									<tr>
										<td>Cod Factura</td>
										<td><input type="text" name="codfactura" value="999999" required="required" /></td>
									</tr>
								</table>
							</fieldset>
							<br> <br>
							<fieldset>
								<legend>Adauga Produse</legend>
								<div id='area'></div>
								<br>
								<center>
									<a onclick='addTextBox(); addAutocomplete()' href='#'>Adauga Produs </a> &nbsp;&nbsp;|&nbsp;&nbsp; <a
										onclick="removeElement(); removeAutoComplete()" href="#">Sterge Produs</a>
								</center>
								<br> <span>Nota: Pretul de iesire va fi considerat pretul actual. Asigurati-va ca este
									actualizat.</span>
							</fieldset>
							<br>
							<table>
								<tr>
									<td style="float: right; margin-right: 50px" class="submit"><input type="submit" name="Save"
										value=Save /></td>
								</tr>
							</table>
						</form>
					</div>
					<!-- end #content -->
					<%@ include file="MainBricks/leftmenu.jsp"%>
					<!-- end #sidebar -->
					<div style="clear: both;">&nbsp;</div>
				</div>
			</div>
		</div>
		<!-- end #page -->
	</div>
	<%@ include file="MainBricks/footer.jsp"%>
	<!-- end #footer -->
</body>
</html>